package com.qing.eduservice.controller;


import com.qing.eduservice.service.EduSubjectService;
import com.qing.servicebase.utils.ResponseResult;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 课程科目 前端控制器
 * </p>
 *
 * @author Yjx
 * @since 2022-09-08
 */
@RestController
@RequestMapping("/eduservice/subject")
public class EduSubjectController {

    private final EduSubjectService subjectService;

    public EduSubjectController(EduSubjectService subjectService) {
        this.subjectService = subjectService;
    }

    //添加课程分类
    @PostMapping("/addSubject")
    public ResponseResult addSubject(@RequestParam("file") MultipartFile file) {
        return subjectService.batchImport(file,subjectService);
    }

    @GetMapping("/nest")
    public ResponseResult nestedList(){
        subjectService.nestedList();
        return subjectService.nestedList();
    }

}

